home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / The Weakest Link / source / OpenTptEnet / CIncludes / DlpiEnet.h next >
Encoding:
C/C++ Source or Header  |  2001-06-23  |  2.8 KB  |  85 lines

  1. /*
  2.     File:        DlpiEnet.h
  3.  
  4.     Contains:    Ethernet DLPI module
  5.  
  6.     Version:    1.0.0
  7.  
  8.     Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #ifndef __DLPIENET_H__
  13. #define __DLPIENET_H__
  14.  
  15. typedef struct Dlpi Dlpi;
  16. typedef Dlpi *DlpiPtr;
  17.  
  18. // DlpiStreamWput() is the STREAMS Write-side put routine.
  19. // Downstream messages are processed here.
  20. // Returns zero.
  21. extern int DlpiStreamWput(queue_t *, mblk_t *);
  22.  
  23. // DlpiStreamWsrv() is the STREAMS Write-side service routine.
  24. // Messages in the write queue are processed here.
  25. // Returns zero.
  26. extern int DlpiStreamWsrv(queue_t *);
  27.  
  28. // DlpiStreamRsrv() is the STREAMS Read-side put routine.
  29. // This is not implemented.
  30. #define DlpiStreamRput NULL
  31.  
  32. // DlpiStreamRsrv() is the STREAMS Read-side service routine.
  33. // Messages in the read queue are processed here.
  34. // Returns zero.
  35. extern int DlpiStreamRsrv(queue_t *);
  36.  
  37. // DlpiStreamClose() is the STREAMS close routine.
  38. extern int DlpiStreamClose(queue_t *, int flag, cred_t *);
  39.  
  40. // DlpiStreamOpen() is the STREAMS open routine.
  41. extern int
  42.     DlpiStreamOpen(DlpiPtr, queue_t *, dev_t *, int flag, int sflag, cred_t *);
  43.  
  44. // DlpiPower() turns the associated hardware on or off.
  45. // Returns false if there was an error.
  46. extern Boolean DlpiPower(DlpiPtr, Boolean on);
  47.  
  48. // DlpiClose() terminates access to the Dlpi module.
  49. // It invalidates the DlpiPtr and returns NULL.
  50. // Returns the DlpiPtr if there was an error.
  51. // WARNING: If there was an error, then the driver is *NOT* closed!
  52. //          This will happen if any buffers were not returned to the pool.
  53. extern DlpiPtr DlpiClose(DlpiPtr);
  54.  
  55. // DlpiOpen() prepares the enet module for operation.
  56. // Full kernel services must be available.
  57. // The Enet module will be opened.
  58. // Returns a pointer to the allocated Dlpi structure.
  59. // Returns NULL if there was an error.
  60. // The txMaxBuffer is the number of buffers in the transmit pool.
  61. // The txMinUnblock is the maximum number of buffers sent before unblocking.
  62. // The txMaxService is the maximum number of buffers that trigger service.
  63. // The rxMaxBuffer is the number of buffers in the receive pool.
  64. // The rxMinService1 is minimum number of buffers that trigger service.
  65. // The rxMinService2 is minimum number of buffers that trigger service.
  66. // The rxMinPass is the minimum number of buffers that allow pass.
  67. // The rxMaxCopy the maximum number of bytes that force copy.
  68. extern DlpiPtr
  69.     DlpiOpen(void *enetCookie,
  70.              char *driverName,
  71.              Count txMaxBuffer,
  72.              Count txMaxService,
  73.              Count txMinUnblock,
  74.              Count rxMaxBuffer,
  75.              Count rxMinService1,
  76.              Count rxMinService2,
  77.              Count rxMinPass,
  78.              Count rxMaxCopy);
  79.  
  80. // DlpiProbe() tests for the existance of Enet hardware.
  81. // Returns false if there is no hardware.
  82. extern Boolean DlpiProbe(void *enetCookie, char *driverName);
  83.  
  84. #endif // __DLPIENET_H__
  85.